Skip to content

Buffer fixes#87

Merged
Gadgetoid merged 3 commits intopimoroni:mainfrom
ahnlak:buffer_fix
Sep 12, 2022
Merged

Buffer fixes#87
Gadgetoid merged 3 commits intopimoroni:mainfrom
ahnlak:buffer_fix

Conversation

@ahnlak
Copy link
Copy Markdown
Contributor

@ahnlak ahnlak commented Sep 12, 2022

Very small fix to initialise allocated storage when creating a new buffer; otherwise you end up with junk in your buffer, and I've had variable success in clearing it up.

The larger fix is to track when buffer() allocates memory when creating a new buffer_t object, and to delete it properly on destruction. Obviously only an issue if you create/discard a lot of buffers, but still...

@ahnlak
Copy link
Copy Markdown
Contributor Author

ahnlak commented Sep 12, 2022

(added the python linting fixes mentioned here)

@Gadgetoid Gadgetoid merged commit edd9a85 into pimoroni:main Sep 12, 2022
@Gadgetoid
Copy link
Copy Markdown
Member

LGTM! Thank you.

@joewreschnig
Copy link
Copy Markdown
Contributor

The destructor unfortunately prevents buffer_t from being used as part of a constexpr (among other things). What about a subtype or wrapper for buffers owning their memory instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants